﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Quartz;

namespace QuartzMVC.Job
{
    /// <summary>
    /// 获取文件夹下所有任务
    /// </summary>
    public class GetTaskJob : IJob
    {

        /// <summary>
        /// 执行方法-作业默认接口
        /// </summary>
        /// <param name="context"></param>
        public void Execute(IJobExecutionContext context)
        {
            string path = @"I:\task";
            List<string> list = new List<string>();
            PublicTool.PublicTool.GetFiles(path, list);

            foreach (var item in list)
            {
                string jsonfile = item;
                System.IO.StreamReader file = System.IO.File.OpenText(jsonfile);

                JsonTextReader reader = new JsonTextReader(file);

                JObject o = (JObject)JToken.ReadFrom(reader);
                string a = o["chenjie"].ToString();
                string b = o["lihao"].ToString();

            }
        }

    }
}